package com.project.webpage.controller;


import com.github.pagehelper.PageInfo;
import com.project.webpage.aop.TagLog;
import com.project.webpage.dto.ClxxParam;
import com.project.webpage.service.ClxxService;
import com.project.webpage.util.RestResult;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/api/webpage/clxx/")
public class ClxxController extends BaseController {

    @Resource
    ClxxService clxxService;

    /**
     * 列表查询
     */
    @PostMapping("page")
    @TagLog(operation = 0, content = "查询车辆列表")
    public RestResult page(@RequestBody ClxxParam param) {
        this.getPage(true, param);
        return RestResult.ok(new PageInfo<>(clxxService.getListForPage(param)));
    }

    /**
     * 导出列表
     */
    @PostMapping("output")
    @TagLog(operation = 5, content = "导出车辆列表")
    public RestResult output(@RequestBody ClxxParam param) {
        this.getPage(false, param);
        return RestResult.ok(clxxService.getListForPage(param));
    }
}
